<!DOCTYPE html>
<html lang="en">
<head>
  <meta charset="UTF-8">
  <meta http-equiv="X-UA-Compatible" content="IE=edge">
  <meta name="viewport" content="width=device-width, initial-scale=1.0">
  <title>css有意思</title>
  <style>
    ul,li {list-style: none;padding: 5px;margin: 0;}
    div.sticky {
      position: -webkit-sticky;
      position: sticky;
      top: 0;
      padding: 5px;
      background-color: #cae8ca;
      border: 2px solid #4CAF50;
    }
    .sticky-lt {
      position: -webkit-sticky;
      position: sticky;
      left: 5px;
    }
    .c-table {
      display: flex;
    }
    .c-table-item {
      min-width: 120px;
      white-space: nowrap;
    }
  </style>
</head>
<body>

  <main>
    <article>
      <p>尝试滚动页面。</p>
      <p>注意: IE/Edge 15 及更早 IE 版本不支持 sticky 属性。</p>
      
      <div class="sticky">我是粘性定位!</div>
      
      <div style="padding-bottom:2000px">
        <p>滚动我</p>
        <p>来回滚动我</p>
        <p>滚动我</p>
        <p>来回滚动我</p>
        <p>滚动我</p>
        <p>来回滚动我</p>
      </div>
    </article>
    <!-- <article>
      <div class="c-table">
        <ul class="sticky-lt c-table-item">
          <li>姓名</li>
          <li>张三</li>
          <li>李四</li>
        </ul>
        <ul class="c-table-item">
          <li>身高</li>
          <li>180</li>
          <li>176</li>
        </ul>
        <ul class="c-table-item">
          <li>出生年月</li>
          <li>2000-12-10</li>
          <li>1999-01-01</li>
        </ul>
        <ul class="c-table-item">
          <li>籍贯</li>
          <li>广州</li>
          <li>北京</li>
        </ul>
        <ul class="c-table-item">
          <li>爱好</li>
          <li>cosplay</li>
          <li>吃鸡</li>
        </ul>
      </div>        
    </article> -->
  </main>  
  
</body>
</html>